﻿using System;
using Duo1JHttpServer.Framework.Utils;

namespace Duo1JHttpServer.Framework.Config
{
    /// <summary>
    /// .properties配置管理器
    /// </summary>
    public static class ConfigManager
    {
        /// <summary>
        /// 服务器主配置
        /// </summary>
        public static Property ServerProperties { get; private set; }

        /// <summary>
        /// 请求映射器配置
        /// </summary>
        public static HandlerConfig HandlerConfig { get; private set; }

        /// <summary>
        /// 过滤器配置
        /// </summary>
        public static FilterConfig FilterConfig { get; private set; }

        /// <summary>
        /// 静态类启动
        /// </summary>
        public static void StartUp()
        {
            ServerProperties = new Property(GlobalDefine.MainConfigPath);
            ConsoleUtils.WriteYellowLine("    ServerProperties");
            ServerProperties.PrintAll();
            HandlerConfig = new HandlerConfig();
            FilterConfig = new FilterConfig();
        }
    }
}